<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="xbsj-labels" content="Earth起步"></meta>
    <title>加载标绘插件</title>
    <!-- 0 引入js文件 -->
    <script src="../../XbsjEarth/XbsjEarth.js"></script>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>

<body>
    <div id="earthContainer" style="width: 100%; height: 100%; background: grey">
    </div>
    <script>
        function startup() {
            const earth = new XE.Earth('earthContainer');

            earth.sceneTree.root = {
                "children": [
                    {
                        "czmObject": {
                            "name": "默认离线影像",
                            "xbsjType": "Imagery",
                            "xbsjImageryProvider": {
                                "createTileMapServiceImageryProvider": {
                                    "url": XE.HTML.cesiumDir + 'Assets/Textures/NaturalEarthII',
                                    "fileExtension": 'jpg',
                                },
                                "type": "createTileMapServiceImageryProvider"
                            }
                        },
                    },
                    {
                        "czmObject": {
                            "xbsjType": "GeoDoubleArrow",
                            "positions": [
                                [1.6988083400554626, 0.6666896940162155, 0],
                                [1.8894540756284692, 0.4816781350611851, 0],
                                [2.040355433442242, 0.5944716085217513, 0],
                                [1.9465554972958719, 0.7028689681340688, 0]
                            ]
                        }
                    }
                ]
            };

            earth.camera.position = [1.9188878818218744, 0.41034917133138266, 2743555.2010588413];
            earth.camera.rotation = [6.173738799303176, -1.1370075117293763, 0.000030663774100325725];

            // only for Debug
            window.earth = earth;
        }

        // 1 XE.ready()会加载Cesium.js等其他资源，注意ready()返回一个Promise对象。
        XE.ready().then(() => {
            // 加载标绘插件
            return XE.HTML.loadJS('../../XbsjEarth-Plugins/plottingSymbol/plottingSymbol.js');
        }).then(() => {
            startup()
        });
    </script>
</body>

</html>